package com.example.happiness.service.admin.Impl;

import com.example.happiness.mapper.OrderDispatchMapper;
import com.example.happiness.pojo.OrderDispatch;
import com.example.happiness.pojo.generalDTO.OrderStateDTO;
import com.example.happiness.service.admin.AdminOrderDispatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class AdminOrderDispatchServiceImpl implements AdminOrderDispatchService {

    @Autowired
    OrderDispatchMapper orderDispatchMapper;

    @Transactional
    public void addOrderDispatch(OrderStateDTO orderStateDTO) {
        OrderDispatch orderDispatch = new OrderDispatch();
        orderDispatch.setOrderid(orderStateDTO.getOrderid());
        orderDispatch.setEid(orderStateDTO.getEid());
        orderDispatch.setProportion(orderStateDTO.getProportion());
        orderDispatchMapper.insert(orderDispatch);
    }
}
